home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
89xx
/
8902c.d64
/
easy triangles
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
4KB
|
119 lines
100 REM *******************************
110 REM * EASY TRIANGLES V1.0 *
120 REM *-----------------------------*
130 REM * (W) BY F. SCHNEIDER IN 1988 *
140 REM * (C) 64'ER (MARKT & TECHNIK) *
150 REM *******************************
160 :
170 S0$=" =":S1$=" "+S0$:S2$="[146][211]EITE ":S3$="[146][215]INKEL "
180 S4$="[211]EITENHALBIERENDE ":S5$="[215]INKELHALBIER. ":S6$="ALPHA":S7$="BETA "
190 S8$="GAMMA":S9$="[200]OEHE AUF "+S2$:GOTO520
200 REM --- RECHENUNTERROUTINEN
210 N=A:P=X
220 M=N*SIN((null)*O/F)/SIN((null)*P/F):RETURN
230 M=(N^2+O^2-P^2)/(2*N*O):IFM>=1ORM<=-1GOTO700
240 M=(-ATN(M/SQR(1-M^2))+(null)/2)*F/(null):RETURN
250 M=SQR(N^2+O^2-2*N*O*COS((null)*P/F)):RETURN
260 IFN<OTHENPOKE2,2
270 M=O*SIN((null)*P/F)/N:M=M+1:M=M-1:IFM=1THENM=90:RETURN
280 IFM>1GOTO700
290 M=ATN(M/SQR(1-M^2))*F/(null):RETURN
300 M=N*SIN((null)*O/F)/(SIN((null)*(F-P/2-O)/F)):RETURN
310 REM --- VERZOEGERUNG / TASTATUR
320 FORI=0TO1500:NEXT:GOTO520
330 POKE198,0
340 GETA$:IFA$=""GOTO340
350 RETURN
360 REM --- SYSTEMROUTINEN
370 D=D-1:IFPEEK(E-D)=1THENPRINT"";
380 RETURN
390 IFA<>0THENO=A:GOSUB260:X=M:GOTO910
400 RETURN
410 IFM<0THENGOTO670
420 E=E+1:IFM<>0THENPOKEE,1:D=D+1:IFE>=2027THEND=D+3
430 RETURN
440 PRINT"[146] --------------------------------------":RETURN
450 PRINT" "S2$"A"S1$;:RETURN
460 PRINT" [159]"S2$"B"S1$;:RETURN
470 PRINT" [153]"S2$"C"S1$;:RETURN
480 PRINT" [153]"S3$S6$S0$;:RETURN
490 PRINT" [159]"S3$S7$S0$;:RETURN
500 PRINT" "S3$S8$S0$;:RETURN
510 REM --- HAUPTPROGRAMM
520 POKE53280,0:POKE53281,0:POKE53272,23:POKE657,128:POKE198,0:POKE2,1
530 FORI=2024TO2029:POKEI,0:NEXT:A=0:B=0:C=0:D=0:E=2023:F=180:X=0:Y=0:Z=0
540 PRINT"[147]"TAB(10)"[197]ASY [212]RIANGLES V1.0"
550 PRINTTAB(6)"(W) BY [198]. [211]CHNEIDER IN 1988":GOSUB450
560 INPUTA:M=A:PRINT:GOSUB410:GOSUB460:INPUTB:M=B:PRINT:GOSUB410:GOSUB470:INPUTC:M=C
570 PRINT"":GOSUB410:GOSUB480:INPUTX:M=X:PRINT:GOSUB410:GOSUB490:INPUTY:M=Y:PRINT
580 GOSUB410:GOSUB500:INPUTZ:M=Z:PRINT:GOSUB410
590 REM --- EINGABE PRUEFEN
600 IFX>=180ORY>=180ORZ>=180ORX+Y>=180ORY+Z>=180ORX+Z>=180GOTO670
610 IFD=9GOTO910
620 IFD=6GOTO780
630 IFD=3GOTO730
640 IFD<3ORD=4ORD=5ORD=8GOTO680
650 IFD=7ORD=10ORD=11ORD>12GOTO690
660 REM --- SYSTEMMELDUNGEN
670 PRINT""TAB(10)"UNZULAESSIGE [215]ERTE !":GOTO320
680 PRINT""TAB(10)"ZU WENIG [208]ARAMETER !":GOTO320
690 PRINT""TAB(9)"NUR 3 [215]ERTE EINGEBEN !":GOTO320
700 PRINT"[147]"TAB(12)"KEINE [204]OESUNG !":GOSUB330:GOTO520
710 REM --- RECHENROUTINEN
720 REM --- 3 SEITEN
730 IFX=0THENN=B:O=C:P=A:GOSUB230:X=M
740 IFY=0THENN=A:O=C:P=B:GOSUB230:Y=M
750 IFZ=0THENN=A:O=B:P=C:GOSUB230:Z=M
760 GOTO1010
770 REM --- 2 SEITEN + EING. WINKEL
780 IFA<>0ANDB<>0ANDZ<>0THENN=A:O=B:P=Z:GOSUB250:C=M:GOTO730
790 IFB<>0ANDC<>0ANDX<>0THENN=B:O=C:P=X:GOSUB250:A=M:GOTO730
800 IFA<>0ANDC<>0ANDY<>0THENN=A:O=C:P=Y:GOSUB250:B=M:GOTO730
810 REM --- 2 SEITEN + 1 WINKEL
820 IFX<>0THENN=A:P=X:GOTO840
830 GOTO860
840 IFB<>0THENO=B:GOSUB260:Y=M:GOTO910
850 O=C:GOSUB260:Z=M:GOTO910
860 IFY<>0THENN=B:P=Y:GOSUB390:GOTO880
870 GOTO890
880 O=C:GOSUB260:Z=M:GOTO910
890 N=C:P=Z:GOSUB390:O=B:GOSUB260:Y=M
900 REM --- 1 SEITE + 2 WINKEL
910 W=F-X-Y-Z
920 IFX=0THENX=W
930 IFY=0THENY=W
940 IFZ=0THENZ=W
950 IFC<>0THENN=C:P=Z:GOTO980
960 IFB<>0THENN=B:P=Y:GOTO980
970 IFA<>0THENO=Y:GOSUB210:B=M:GOTO990
980 O=X:GOSUB220:A=M:IFB=0THENO=Y:GOSUB210:B=M:GOTO1010
990 O=Z:GOSUB210:C=M
1000 REM --- HOEHEN/S.-HALB./W.-HALB.
1010 HA=B*SIN((null)*Z/F):HB=C*SIN((null)*X/F):HC=A*SIN((null)*Y/F):N=A/2:O=C:P=Y:GOSUB250:SA=M
1020 N=B/2:O=A:P=Z:GOSUB250:SB=M:N=C/2:O=B:P=X:GOSUB250:SC=M:N=C:O=Y:P=X:GOSUB300
1030 WAL=M:N=A:O=Z:P=Y:GOSUB300:WBE=M:N=B:O=X:P=Z:GOSUB300:WGA=M:UM=A+B+C
1040 FL=.5*A*B*SIN((null)*Z/F)
1050 REM --- LOESUNGEN AUSGEBEN
1060 D=6:G=65:IFPEEK(2)=3THENG=66
1070 PRINT"[147]"TAB(9)"[204]OESUNGEN "CHR$(G)":":GOSUB450:GOSUB370:PRINTA:GOSUB460
1080 GOSUB370:PRINTB:GOSUB470:GOSUB370:PRINTC:GOSUB440:GOSUB480:GOSUB370:PRINTX
1090 GOSUB490:GOSUB370:PRINTY:GOSUB500:GOSUB370:PRINTZ:GOSUB440
1100 PRINT" "S9$"A ="HA:PRINT" [159]"S9$"B ="HB:PRINT" [153]"S9$"C ="HC:GOSUB440
1110 PRINT" [153]"S4$"A ="SA:PRINT" [159]"S4$"B ="SB:PRINT" "S4$"C ="SC:GOSUB440
1120 PRINT" "S5$S6$" ="WAL:PRINT" [159]"S5$S7$" ="WBE:PRINT" [153]"S5$S8$" ="WGA:GOSUB440
1130 PRINT" [153][198]LAECHENINHALT ="FL:PRINT" [159][213]MFANG "S1$UM:GOSUB330:CLOSE1
1140 IFA$="[136]"THENOPEN1,4,0:CMD1:GOTO1060
1150 IFPEEK(2)<>2GOTO520
1160 REM --- 2. LOESUNG BEI SSW(K)
1170 POKE2,3:IFPEEK(E-2)=1GOTO1210
1180 IFPEEK(E-1)=1GOTO1230
1190 IFPEEK(E-5)=1THENB=0:Y=0:GOTO1270
1200 A=0:X=0:GOTO1260
1210 IFPEEK(E-4)=1THENC=0:Z=0:GOTO1260
1220 B=0:Y=0:GOTO1250
1230 IFPEEK(E-5)=1THENC=0:Z=0:GOTO1270
1240 A=0:X=0
1250 Z=F-Z:GOTO910
1260 Y=F-Y:GOTO910
1270 X=F-X:GOTO910